(function(k){var g=[];
var l=false;
var c=[];
var q={screenLockerBackground:"#a1a1a1",screenLockerOpacity:"0.1"};
var e={cn:{close:"关闭",confirm:"确定",cancel:"取消",titleInfo:"系统提示"},en:{close:"close",confirm:"Yes",cancel:"No",titleInfo:"System prompts"}};
var i='<div class="pop"><span class="popShadow pShadow160">&nbsp;</span><div class="popWrap" style="height:144px"><div class="hd"><h3>TITLEINFO</h3><button class="btn btnPopClose" onclick="$.closePopupLayer(\'sysConfirmPop\')">&nbsp;</button></div><div class="popContent"><div class="warn"><strong>TEXTINFO</strong></div><p class="popBtn"><a id="confirmYes" href="javascript:void(0)" title="Yes" class="btn btnSureSml"><span>YESTAG</span></a>&nbsp;&nbsp;<a id="confirmNo" href="javascript:void(0)"  title="No" class="btn btnCanSml"><span>NOTAG</span></a></p></div></div></div>';
var b='<div class="pop"><span class="popShadow pShadow160">&nbsp;</span><div class="popWrap" style="height:144px"><div class="hd"><h3>TITLEINFO</h3><button class="btn btnPopClose" onclick="$.closePopupLayer(\'sysAlertPop\')">&nbsp;</button></div><div class="popContent"><div class="warn"><strong>TEXTINFO</strong></div><p class="popBtn"><a id="alertYes" href="javascript:void(0)" title="Yes" class="btnOk"><span>YESTAG</span></a></p></div></div></div>';
k.setupJMPopups=function(r){q=jQuery.extend(q,r);
return this
};
k.openPopupLayer=function(r){if(typeof(r.name)!="undefined"&&!o(r.name)){r=jQuery.extend({width:"auto",height:"auto",parameters:{},target:"",content:"",success:function(){},error:function(){},beforeClose:function(){},afterClose:function(){},reloadSuccess:null,cache:false,enableScreenLockClick:false},r);
n(r,true);
return this
}};
k.openPopupAlertLayer=function(r){r=jQuery.extend({width:"auto",height:"auto",parameters:{},name:"sysAlertPop",target:"sysAlert",titleInfo:j("titleInfo"),textInfo:"",success:function(){},error:function(){},beforeClose:function(){},afterClose:function(){},yesClick:function(){},reloadSuccess:null,cache:false,enableAutoClose:true,enableScreenLockClick:false},r);
n(r,true);
return this
};
k.openPopupConfirmLayer=function(r){r=jQuery.extend({width:"auto",height:"auto",parameters:{},name:"sysConfirmPop",target:"sysConfirm",titleInfo:j("titleInfo"),textInfo:"",success:function(){},error:function(){},beforeClose:function(){},afterClose:function(){},noClick:function(){},reloadSuccess:null,cache:false,enableAutoClose:true,enableScreenLockClick:false},r);
n(r,true);
return this
};
k.closePopupLayer=function(r){if(r){for(var s=0;
s<g.length;
s++){if(g[s].name==r){var t=g[s];
g.splice(s,1);
t.beforeClose();
k("#popupLayer_"+r).fadeOut(-1,function(){k("#popupLayer_"+r).remove();
c.pop();
if(c.length>0){k(c[c.length-1]).focus()
}t.afterClose();
p(r)
});
break
}}}else{if(g.length>0){k.closePopupLayer(g[g.length-1].name)
}}return this
};
k.reloadPopupLayer=function(r,t){if(r){for(var s=0;
s<g.length;
s++){if(g[s].name==r){if(t){g[s].reloadSuccess=t
}n(g[s],false);
break
}}}else{if(g.length>0){k.reloadPopupLayer(g[g.length-1].name)
}}return this
};
function f(){if(l){k("#popupLayerScreenLocker").height(k(document).height()+"px");
k("#popupLayerScreenLocker").width(k(document.body).outerWidth(true)+"px")
}}function o(r){if(r){for(var s=0;
s<g.length;
s++){if(g[s].name==r){return true
}}}return false
}function h(r){k(document.body).css("overflow","hidden");
if(k("#popupLayerScreenLocker").length){if(g.length==1){l=true;
f();
k("#popupLayerScreenLocker").show()
}if(k.browser.msie&&k.browser.version<7){k("select:not(.hidden-by-jmp)").addClass("hidden-by-jmp hidden-by-"+g[g.length-1].name).css("visibility","hidden")
}k("#popupLayerScreenLocker").css("z-index",parseInt(g.length==1?999:k("#popupLayer_"+g[g.length-2].name).css("z-index"))+1)
}else{k("body").append("<div id='popupLayerScreenLocker'><!-- --></div>");
k("#popupLayerScreenLocker").css({position:"absolute",background:q.screenLockerBackground,left:"0",top:"0",opacity:q.screenLockerOpacity,display:"none",overflow:"hidden"});
h(r);
if(typeof r.enableScreenLockClick!="undefined"&&r.enableScreenLockClick==true){k("#popupLayerScreenLocker").click(function(){k.closePopupLayer()
})
}}}function p(r){if(g.length==0){screenlocker=false;
k("#popupLayerScreenLocker").fadeOut(-1)
}else{k("#popupLayerScreenLocker").css("z-index",parseInt(k("#popupLayer_"+g[g.length-1].name).css("z-index"))-1)
}if(k.browser.msie&&k.browser.version<7){k("select.hidden-by-"+r).removeClass("hidden-by-jmp hidden-by-"+r).css("visibility","visible")
}k(document.body).removeAttr("style")
}k.setPopupLayersPosition=function(y,t){if(y){if(y.width()<k(window).width()){var w=(document.documentElement.offsetWidth-k(".pop",y).width())/2
}else{var w=document.documentElement.scrollLeft+5
}var s=parent.document.documentElement.clientHeight;
var x=document.documentElement.scrollTop||document.body.scrollTop;
if(y.height()<s){var v=x+(s-k(".pop",y).height())/2
}else{var v=x+5
}var r={left:w+"px",top:v+"px"};
if(!t){y.css(r)
}else{y.animate(r,4000,"swing")
}f()
}else{for(var u=0;
u<g.length;
u++){k.setPopupLayersPosition(k("#popupLayer_"+g[u].name),true)
}}};
function d(r,x,w){var v="popupLayer_"+r.name;
if(x){h(r);
k("body").append("<div id='"+v+"'><!-- --></div>");
var y=parseInt(g.length==1?1000:k("#popupLayer_"+g[g.length-2].name).css("z-index"))+2
}else{var y=k("#"+v).css("z-index")
}var z=k("#"+v);
z.css({visibility:"hidden",width:r.width=="auto"?"":r.width+"px",height:r.height=="auto"?"":r.height+"px",position:"absolute","z-index":y});
var u="<a href='#' class='jmp-link-at-top' style='position:absolute; left:-9999px; top:-1px;'>&nbsp;</a><input class='jmp-link-at-top' style='position:absolute; left:-9999px; top:-1px;' />";
var s="<a href='#' class='jmp-link-at-bottom' style='position:absolute; left:-9999px; bottom:-1px;'>&nbsp;</a><input class='jmp-link-at-bottom' style='position:absolute; left:-9999px; top:-1px;' />";
z.html(u+w+s);
k.setPopupLayersPosition(z);
z.css("display","none");
z.css("visibility","visible");
if(x){z.fadeIn(-1)
}else{z.show()
}k("#"+v+" .jmp-link-at-top, #"+v+" .jmp-link-at-bottom").focus(function(){k(c[c.length-1]).focus()
});
var t=k("#"+v+" a:visible:not(.jmp-link-at-top, .jmp-link-at-bottom), #"+v+" *:input:visible:not(.jmp-link-at-top, .jmp-link-at-bottom)");
if(t.length==0){var A="<a href='#' class='jmp-link-inside-popup' style='position:absolute; left:-9999px;'>&nbsp;</a>";
z.find(".jmp-link-at-top").after(A);
c.push(k(z).find(".jmp-link-inside-popup")[0])
}else{t.each(function(){if(!k(this).hasClass("jmp-link-at-top")&&!k(this).hasClass("jmp-link-at-bottom")){c.push(this);
return false
}})
}k(c[c.length-1]).focus();
r.success();
if(r.reloadSuccess){r.reloadSuccess();
r.reloadSuccess=null
}if(r.yesClick){if(r.name=="sysAlertPop"){k("#alertYes").bind("click",function(){if(r.enableAutoClose){k.closePopupLayer("sysAlertPop")
}r.yesClick()
})
}else{if(r.name=="sysConfirmPop"){k("#confirmYes").bind("click",function(){if(r.enableAutoClose){k.closePopupLayer("sysConfirmPop")
}r.yesClick()
})
}}}if(r.noClick){if(r.name=="sysConfirmPop"){k("#confirmNo").bind("click",function(){if(r.enableAutoClose){k.closePopupLayer("sysConfirmPop")
}r.noClick()
})
}}m(v)
}function n(r,t){if(t){g.push(r)
}if(r.target!=""){if(typeof r.textInfo!="undefined"){var s="";
if(r.name=="sysAlertPop"){s=b.replace(/CLOSETAG/ig,j("close")).replace(/YESTAG/ig,j("confirm"));
s=s.replace(/TEXTINFO/ig,r.textInfo);
s=s.replace(/TITLEINFO/ig,r.titleInfo);
s=s.replace(/STYLEINFO/ig,r.styleInfo)
}else{if(r.name=="sysConfirmPop"){s=i.replace(/CLOSETAG/ig,j("close")).replace(/YESTAG/ig,j("confirm")).replace(/NOTAG/ig,j("cancel"));
s=s.replace(/TEXTINFO/ig,r.textInfo);
s=s.replace(/TITLEINFO/ig,r.titleInfo);
s=s.replace(/STYLEINFO/ig,r.styleInfo)
}}d(r,t,s)
}else{d(r,t,k("#"+r.target).html())
}}else{if(r.content!=""){d(r,t,r.content)
}else{k.ajax({url:r.url,data:r.parameters,cache:r.cache,dataType:"html",method:"GET",complete:function(x,w){if("success"==w){var v=x.getResponseHeader("requestSuccess4Ajax");
if(v=="0"){SMT.func(config.exceptionProcess)
}else{if(v=="2"){SMT.func(config.reLogonProcess)
}else{if(v=="3"){SMT.func(config.timeOutProcess)
}else{var u=k.trim(x.responseText);
d(r,t,u)
}}}}},error:r.error})
}}}function a(s){var t=document.getElementById(s);
var r=k(".popWrap > div[class=hd]",k(t));
k("#"+idElement).draggable({handle:r});
r.css({cursor:"move"})
}function m(B){var s=document.documentElement.clientWidth;
var r=document.documentElement.clientHeight;
var u=0;
var t=0;
var w=0;
var x=0;
var A=document.onmousemove;
var z=document.onmouseup;
var v=document.getElementById(B);
var C=k(".popWrap > div[class=hd]",k(v));
if(v!=null){C.css({cursor:"move"});
C.mousedown(function(){var D=y();
var E=true;
u=D.clientX;
t=D.clientY;
w=parseInt(v.style.top);
x=parseInt(v.style.left);
if(k.browser.mozilla){k("div.popup").css({"-moz-user-select":"none"});
k(document.body).css({"-moz-user-select":"none"})
}else{document.body.onselectstart=function(){return false
};
document.body.onselect=function(){return false
}
}document.onmousemove=function(){if(E){var G=y();
var F=x+G.clientX-u;
var H=w+G.clientY-t;
v.style.left=F+"px";
v.style.top=H+"px"
}};
document.onmouseup=function(){if(E){document.onmousemove=A;
document.onmouseup=z;
E=false
}if(k.browser.mozilla){k("div.popup").removeAttr("style")
}else{document.body.onselectstart=function(){return true
};
document.body.onselect=function(){return true
}
}}
})
}function y(){return window.event||arguments.callee.caller.arguments[0]
}}function j(s){var r="cn";
if(typeof(config)!="undefined"&&typeof(config.lans)!="undefined"&&typeof(config.lans.localeDesc)!="undefined"){r=config.lans.localeDesc
}return e[r][s]
}})(jQuery);